package com.ran.cpuGame;

import android.util.Log;

import java.util.LinkedList;
import java.util.List;

public class MyThread extends Thread {
    public static List<MyThread> myThreads = new LinkedList();
    int i;

    public void run() {
        super.run();
        for (int i = 0; i < 2; i++)
            new MyThread().start();
        while (true)
            this.i = (1 + this.i);
    }

    public void start() {
        try {
            myThreads.add(this);
            Log.i("ran", "长度" + myThreads.size());
            super.start();
            return;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}